package com.koron.tool.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.HashMap;
import java.util.Map;

/**
 * @Author: laiguangming
 * @Date: 2023/7/27 18:00
 */
@Getter
@AllArgsConstructor
public enum ToolAvailableStatus {

    /**
     * 可用
     */
    AVAILABLE("available", "可用"),

    /**
     * 已报废
     */
    SCRAP("scrap", "已报废"),

    /**
     * 检验中
     */
    INSPECTION("inspection", "检验中")
    ;

    private final String value;

    private final String description;

    /**
     * 获取枚举的 Map, Entry(value, description)
     * @return
     */
    public static Map<String, String> getMap() {
        Map<String, String> map = new HashMap<>();
        ToolAvailableStatus[] enums = ToolAvailableStatus.values();
        for (ToolAvailableStatus toolAvailableStatus : enums) {
            map.put(toolAvailableStatus.getValue(), toolAvailableStatus.getDescription());
        }
        return map;
    }

}
